function foo() {

}

type FooType = () => void

function bar(fn: FooType) {

}

bar(foo)

// 定义常量时
type AddFn = (n: number, n2: number) => void
const add: AddFn = (num1: number, num2: number) => {
    return num1 + num2
}
 